
** Set directory

cd "/win/l1werpfile2/Shared/Olivia/Rob/Covid_Unemployment_Paths"

** Load-in data

use "Intermediate/cps_asec_merged_v2.dta", replace

** Merge-in new data

merge m:1 id using "Intermediate/to_be_merged.dta", nogen

replace UI_CARES = 0 if UI == 0
drop index q1 q2 q3 q4 

** Label variables

label var month "Month of interview"
label var peridnum "Unique person ID (household ID + person line number)"
label var prcitshp "Citizenship status"
label var hrswk "Typical # of hours per week worked in 2019"
label var lkweeks "Number of weeks unemployed in 2019"
label var pearnval "Total persons earnings in 2019"
label var ptotval "Total persons income in 2019"
label var ptweeks "# of weeks worked < 35 hours in 2019"
label var rsnnotw "Reason for not working in 2019"
label var wemind "Major industry of longest job held in 2019"
label var wemocg "Major occupation of longest job held in 2019"
label var wewkrs "Weeks worked in prior year recode"
label var workyn "Worked at all in 2019 dummy"
label var fearnval "Total family earnings (of primary family for related subfamilies)"
label var fsup_wgt "Family ASEC weight (of primary family for related subfamilies)"
label var ftotval "Total family income (of primary family for related subfamilies)"
label var h_idnum "Unique HH ID"
label var hearnval "Total household earnings in 2019"
label var hsup_wgt "HH ASEC weight"
label var htotval "Total household income in 2019"
label var citizen "Citizen dummy"
label var weekly_earnings "2019 earnings/weeks worked in 2019"
label var balanced "Appears in sample for 4 consecutive months"
label var ernwk "Weekly earnings from 2020 earner study"
label var urate2 "urate squared"
label var urate3 "urated cubed"
label var marsupwt "ASEC supplement final weight"
label var wkswork "# of weeks worked in 2019"
label var duration2 "duration adjusted for lfstat2"
label var elig "=1 if unemployed person lost permanent or temporary job"
label var elig2 "elig adjusted for lfstat2"
label var married "=1 if married (spouse present)"
label var majind2 "majind adjusted for lfstat2"
label var laborstatus "detailed labor force status"
label var misclassified_flag "=1 if employed & potentially misclassified"
label var pwlgwgt "longitudinal weight"

** Save datasets

save "Output/CPS_2020_unbalanced_v2.dta", replace

keep if balanced == 1

save "Output/CPS_2020_balanced_v2.dta", replace
